<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
	<ui:composition template="template/template.xhtml">
		<ui:define  name="page-title" >XXXXStock</ui:define >
		<ui:define  name="center">
			<h:outputText styleClass="title" value="Stock Deposito: #{centroController.deposito.nome}"/>		 			
       		<p:dataTable id="tabelaStock" var="stock" value="#{centroController.depositoStock}"  
	                 paginator="true" rows="10"  paginatorPosition="bottom" rowStyleClass="#{(stock.quantidade lt stock.limite)  || (stock.quantidade eq stock.limite)?'alerta':''}"
	                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} "  
	                 rowsPerPageTemplate="5,10,15">  
	        
		        <f:facet name="header">  
		           	Stock
		        </f:facet>  
		  
		        <p:column>  
		            <f:facet name="header">  
		                <h:outputText value="#{messages.id}" />  
		            </f:facet>  
		            <h:outputText value="#{stock.id}" />  
		        </p:column>  
		        
		        <p:column>  
		            <f:facet name="header">  
		                <h:outputText value="#{messages.deposito}" />  
		            </f:facet>  
		            <h:outputText value="#{stock.deposito.nome}" />  
		        </p:column>
		        
		        <p:column>  
		            <f:facet name="header">  
		                <h:outputText value="#{messages.material}" />  
		            </f:facet>  
		            <h:outputText value="#{stock.material.nome}" />  
		        </p:column>  
		        
		        <p:column>  
		            <f:facet name="header">  
		                <h:outputText value="#{messages.limite}" />  
		            </f:facet>  
		            <h:outputText value="#{stock.limite}" />  
		        </p:column>
		  
		        <p:column>  
		            <f:facet name="header">  
		                <h:outputText value="#{messages.quantidade}" />  
		            </f:facet>  
		            <h:outputText value="#{stock.quantidade}" />  
		        </p:column>  
		  
		        <p:column>  
		            <f:facet name="header">  
		                <h:outputText value="Date Actualização" />  
		            </f:facet>  
		            <h:outputText value="#{stock.dataActualizacao}" />  
		        </p:column> 
	     
	    	</p:dataTable>
 			<p:commandButton value="#{messages.voltar}" async="true" action="centroDepositos" immediate="true" ajax="false"/>
		</ui:define >
	</ui:composition>
	
</html>